﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="MissingPersons2.aspx.cs" Inherits="MissingPersons2" %>

<asp:Content ID="content1" runat="server" ContentPlaceHolderID="MainContentPlaceHolder">
    <div style="height: 474px">
        <table style="width: 100%;">
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                        DataKeyNames="ID_number" DataSourceID="SqlDataSource1" Height="407px" 
                        Width="618px" AllowPaging="True" CellPadding="4" ForeColor="#333333" 
                        GridLines="None">
                        <AlternatingRowStyle BackColor="White" />
                        <CommandRowStyle BackColor="#C5BBAF" Font-Bold="True" />
                        <EditRowStyle BackColor="#7C6F57" />
                        <FieldHeaderStyle BackColor="#D0D0D0" Font-Bold="True" />
                        <Fields>
                            <asp:BoundField DataField="ID_number" HeaderText="ID_number" ReadOnly="True" 
                                SortExpression="ID_number" />
                            <asp:BoundField DataField="Fname" HeaderText="Fname" SortExpression="Fname" />
                            <asp:BoundField DataField="Lname" HeaderText="Lname" SortExpression="Lname" />
                            <asp:BoundField DataField="ID_mark" HeaderText="ID_mark" 
                                SortExpression="ID_mark" />
                            <asp:BoundField DataField="Loc" HeaderText="Loc" SortExpression="Loc" />
                            <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
                            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" 
                                ShowInsertButton="True" />
                        </Fields>
                        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#E3EAEB" />
                    </asp:DetailsView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:PAS_DB %>" 
                        DeleteCommand="DELETE FROM [MissingPerson] WHERE [ID_number] = @ID_number" 
                        InsertCommand="INSERT INTO [MissingPerson] ([ID_number], [Fname], [Lname], [ID_mark], [Loc], [Date]) VALUES (@ID_number, @Fname, @Lname, @ID_mark, @Loc, @Date)" 
                        SelectCommand="SELECT * FROM [MissingPerson]" 
                        UpdateCommand="UPDATE [MissingPerson] SET [Fname] = @Fname, [Lname] = @Lname, [ID_mark] = @ID_mark, [Loc] = @Loc, [Date] = @Date WHERE [ID_number] = @ID_number">
                        <DeleteParameters>
                            <asp:Parameter Name="ID_number" Type="String" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="ID_number" Type="String" />
                            <asp:Parameter Name="Fname" Type="String" />
                            <asp:Parameter Name="Lname" Type="String" />
                            <asp:Parameter Name="ID_mark" Type="String" />
                            <asp:Parameter Name="Loc" Type="String" />
                            <asp:Parameter Name="Date" Type="DateTime" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="Fname" Type="String" />
                            <asp:Parameter Name="Lname" Type="String" />
                            <asp:Parameter Name="ID_mark" Type="String" />
                            <asp:Parameter Name="Loc" Type="String" />
                            <asp:Parameter Name="Date" Type="DateTime" />
                            <asp:Parameter Name="ID_number" Type="String" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
    </asp:Content>
    
<asp:Content ID="Content2" runat="server" contentplaceholderid="head">
    <style type="text/css">
        .style2
        {
            width: 197px;
        }
    </style>
</asp:Content>

    
